package demoMod.invincibleOne.cards.invincible;

import basemod.helpers.CardModifierManager;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import demoMod.invincibleOne.InvincibleOneMod;
import demoMod.invincibleOne.enums.AbstractCardEnum;
import demoMod.invincibleOne.enums.CardTagsEnum;
import demoMod.invincibleOne.interfaces.MonsterRegenOrMaxHPApplyHook;
import demoMod.invincibleOne.modifiers.ExhaustAtStartOfCombatMod;

public class BigIsBetter extends AbstractInvincibleCard implements MonsterRegenOrMaxHPApplyHook {
    public static final String ID = InvincibleOneMod.makeID("BigIsBetter");

    private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    public static final String NAME = cardStrings.NAME;
    public static final String DESCRIPTION = cardStrings.DESCRIPTION;
    public static final String IMG_PATH = "cards/BigIsBetter.png";

    private static final CardType TYPE = CardType.SKILL;
    private static final CardRarity RARITY = AbstractCardEnum.LEGENDARY;
    private static final CardTarget TARGET = CardTarget.NONE;

    private static final int COST = -2;

    public BigIsBetter() {
        super(ID, NAME, InvincibleOneMod.getResourcePath(IMG_PATH), COST, DESCRIPTION, TYPE, RARITY, TARGET);
        this.modifier = new ExhaustAtStartOfCombatMod();
        CardModifierManager.addModifier(this, modifier);
        this.tags.add(CardTagsEnum.ALERT);
        this.baseMagicNumber = this.magicNumber = 50;
    }

    @Override
    public Runnable getUpgradeAction() {
        return () -> upgradeMagicNumber(25);
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {

    }

    @Override
    public float onRegenApply(AbstractCreature target, float regenAmount) {
        return regenAmount;
    }

    @Override
    public float onMaxHpIncreased(AbstractCreature target, float maxHpGained) {
        return maxHpGained * (1.0F + this.magicNumber / 100.0F);
    }
}
